import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
import Home from '../views/Home.vue'
import Article from '../views/Article.vue'
import Detail from '../views/Detail.vue'
import SearchPage from '../views/SearchPage.vue'
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/article/:id?',
    name: 'Article',
    component: Article
  },
  {
    path: '/detail/:id?',
    name: 'Detail',
    component: Detail
  },
  {
    path: '/searchPage/:id?',
    name: 'SearchPage',
    component: SearchPage
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router